<template>
  <!--
    	作者：Mr.z
    	时间：2024-05-15
    	描述：diy组件 新人优惠卷
    -->
  <div>
    <div class="common-form">
      <span>{{ curItem.name }}</span>
    </div>
    <el-form size="small" :model="curItem" label-width="100px">
      <!--上下边距-->
      <el-form-item label="上边距："><el-slider v-model="curItem.style.paddingTop" show-input></el-slider></el-form-item>
      <!--上下边距-->
      <el-form-item label="下边距："><el-slider v-model="curItem.style.paddingBom" show-input></el-slider></el-form-item>
      <!--左右边距-->
      <el-form-item label="左右边距："><el-slider v-model="curItem.style.paddingLR" show-input></el-slider></el-form-item>
      <!--背景颜色-->
      <el-form-item label="背景颜色：">
        <div class="d-s-c">
          <el-color-picker v-model="curItem.style.background" show-alpha></el-color-picker>
          <el-button type="button" style="margin-left: 10px;" @click.stop="$parent.onEditorResetColor(curItem.style, 'background', '#ffffff')">重置</el-button>
        </div>
      </el-form-item>
      <el-form-item label="优惠卷来源：">
        <el-radio-group v-model="curItem.params.source">
          <el-radio :label="'auto'">自动获取</el-radio>
        </el-radio-group>
      </el-form-item>
      <!-- 自动获取 -->
      <template v-if="curItem.params.source == 'auto'">
        <!-- 显示数量 -->
        <el-form-item label="最多显示数量："><el-input v-model="curItem.params.auto.showNum" class="w-auto"></el-input></el-form-item>
      </template>
      <!-- 领取方式 -->
      <el-form-item label="领取方式：">
        <el-radio-group v-model="curItem.params.receive">
          <el-radio :label="'all'">一键领取</el-radio>
          <el-radio :label="'one'">逐个领取</el-radio>
        </el-radio-group>
      </el-form-item>
      <!--显示数量-->
      <!-- <el-form-item label="显示数量："><el-slider v-model="curItem.params.limit" :min="1" :max="5" show-input></el-slider></el-form-item> -->
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: ['curItem', 'selectedIndex', 'opts'],
  created() {
    this.curItem.style.paddingTop = parseInt(this.curItem.style.paddingTop);
    this.curItem.params.limit = parseInt(this.curItem.params.limit);
  },
  methods: {}
};
</script>

<style></style>
